package com.wx.spider.sql.controller;

import com.wx.spider.common.model.CommonResponse;
import com.wx.spider.common.pojo.db.MqErrorLog;
import com.wx.spider.sql.service.MqErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:feng
 * @create:2021-04-25 12:46
 */
@RestController
@RequestMapping("/mqerrorlog")
public class MqErrorLogController {
    @Autowired
    private MqErrorLogService mqErrorLogService;


    @PostMapping("/save")
    private CommonResponse<MqErrorLog> save(@RequestBody MqErrorLog mqErrorLog){
        try{

            boolean flag = mqErrorLogService.save(mqErrorLog);
            if(flag){
                return CommonResponse.succeed(mqErrorLog);
            }else{
                return CommonResponse.INTERNAL_ERROR_RESPONSE;
            }
        }catch (Exception e) {
            e.printStackTrace();
            return CommonResponse.INTERNAL_ERROR_RESPONSE;
        }
    }
}
